home *** CD-ROM | disk | FTP | other *** search
- GNMIDFMT HELP ON MIDI FORMATS
- ==================================================================
-
- Standard MIDI file format (.mid) is available in 3 different formats:
- Format 0, Format 1, Format 2
-
- The numbers 0-2 are from header of .mid files.
-
- The MIDI format is also known as MIDI type, MIDI version.
- The 3 formats are not totally different encoded, only different
- organized and interpretated.
-
- Generally for all formats
- -------------------------
- A midi file consists of a simple header and one or more tracks.
- Each track contains pauses and MIDI commands. Most MIDI commands (e.g.
- notes, controllers, ...) are identical to MIDI standard protocol, some
- commands were added special to MIDI file format (META Events, e.g. tempo,
- tact, text ...).
- Within a track the commands are interpretated (e.g. played) in order
- of occurence, the pauses between commands delay the interpretation for
- certain time. Many commands (e.g. notes) are assigned to a channel (1-16)
- which defines a sound setup at a time (e.g. channel 10 plays drums at
- certain volume with some effects).
-
- The MIDI format (0,1,2) decide
- * how many tracks are allowed
- * what tracks should contain (channels, commands)
- * how tracks are played together with others (parallel, serial)
- * how tempo is controlled
-
- MIDI Format 0
- --------------
- * A format 0 MIDI file has only one track.
- * This track contains all commands of all 16 channels and they are
- sorted by time depending on the pauses between commands.
- * The only available track contains whole song.
- * Tempo is applied when it occurs inside the format 0 track.
-
- The MIDI format 0 is very popular, all MIDI players support this
- format. Many devices (keyboards, modules, players) support only
- this format, because it is easier to handle (commands are already
- sorted by time, player only needs to wait the pauses and then fire
- command after command to the synthesizer).
-
- MIDI Format 1
- --------------
- * Format 1 MIDI file has at least one track. Number is not limited
- except by certain applications (usually to 256 tracks)
- * First track is intended for conductor and contains only commands
- that are not channel depending (tempo, tact, text, key,...).
- Each other track should not contain tempo or tact, it should contain
- commands for certain channel (1-16). Some applications also allow
- using more channels in a track. It is allowed to use more tracks
- with a certain channel, the tracks share the setup of this channel
- if the commands refer to same output device (port).
- * The tracks play together at same time (parallel).
- All tracks together are one song.
- * Tempo and tact should be only used in conductor track (first track),
- the other tracks play to conductors timing.
-
- The MIDI format 1 is very popular, most software players and editors
- (MIDI Sequencer) support this format. Human like it because it allows
- to organize own sequences logically (a track for conductor, for bass,
- for melody, for strings, for lyrics, ...). This format is also
- popular for printing, each track can be printed as a stuff line in
- a score sheet. Karaoke files *.kar are in this format.
- For hardware players this format is more difficult to support because
- the commands from all tracks must be merged before playing or at
- realtime. Many (older) keyboards don't support loading format 1
- to save costs.
-
- MIDI Format 2
- --------------
- * MIDI format 2 has at least one track, usually more tracks
- * each track contains a whole song, all songs have same resolution (= units per quarternote)
- * the tracks play one after one (serial), single tracks/songs can be referenced
- by an application to play certain song or song list in certain order.
- * each song is itself organized like a format 0 song, all commands including tempo
- are within a track.
-
- The MIDI format 2 is rarely used, most players and editors can't read
- this format. It is used by few applications to archive more songs
- to access songs by random or to organize depending songs in a package.
- It is not recommended to distribute songs in this format.
-
- Conversions
- ===========
- MIDI format 1 to 0
- ------------------
- All tracks are merged to one track, commands must be sorted by time.
- The conversion looses information:
- track number where the command was originally
- (e.g. a track for piano left hand and one for right hand on
- same track, the tracks are merged and distinguish
- left/right hand is not available anymore).
-
- MIDI format 1 to 2
- ------------------
- First format 1 must be converted to format 0, then the format is
- close to format 2 and can be converted to format 2 (see format 0 to 2).
-
- MIDI format 0 to 2
- ------------------
- One format 0 song is nearly format 2, only the format indicator must be set to 2.
- If more songs are included in the format 2 then
- must modify the midi resolution to a common factor and recalculate
- the pauses relative to the new resolution.
- The quantization to new resolution can generate small inexactness
- in pauses. Best new resolution is smallest common multiplicator of all
- resolutions. The resolution value should not be too high, because some
- players don't support high precision resolution and refuse playing them.
-
- MIDI format 0 to 1
- -------------------
- The single track must be divided into more tracks.
- Usually this is done by seperating the timing information (tact, tempo)
- into first track (conductor) and the individual channels into own tracks.
- It is also possible to create seperate tracks for each program and
- for each drum instrument.
- (GNMIDI has operations to split programs and drums)
- The seperation into tracks is not unique, applications can use different
- ways.
-
-
- MIDI format 2 to 0
- ------------------
- A MIDI format 2 can contain several songs, which are all nearly format 0
- formatted. Generate a new midi file format 0 for each of these files.
- The files have same resolution.
-
- MIDI format 2 to 1
- ------------------
- MIDI format 2 must first be converted to one or more format 0 files,
- then each one can be converted to format 1 (see format 0 to 1).
-
-
-